all: parallel_sort line

parallel_sort: parallel_sort.cpp scan.h reduce.h global.h
	g++ -g -Wall -I${TACC_PAPI_INC} -pthread -c parallel_sort.cpp
	g++ -g -pthread -Wl,-rpath,${TACC_PAPI_LIB} -L${TACC_PAPI_LIB} -lpapi parallel_sort.o -o parallel_sort
	rm -f *.o

pp: pp.cpp scan.h
	g++ -g -Wall -I${TACC_PAPI_INC} -pthread -c pp.cpp
	g++ -g -pthread -Wl,-rpath,${TACC_PAPI_LIB} -L${TACC_PAPI_LIB} -lpapi pp.o -o pp
	rm -f *.o

line: line_sight.cpp scan.h global.h
	g++ -g -Wall -I${TACC_PAPI_INC} -pthread -c line_sight.cpp
	g++ -g -pthread -Wl,-rpath,${TACC_PAPI_LIB} -L${TACC_PAPI_LIB} -lpapi line_sight.o -lm -o line_sight

clean:
	rm -f *.o sort histogram parallel_sort line_sight pp
